#include <iostream>

int main() {
    int n,k;
    double sumA=0,sumB=0;
    int countA=0,countB=0;
    scanf("%d%d",&n,&k);
    for (int i = 1; i <= n; ++i) {
        if (i%k==0){
            sumA+=i;
            countA++;
        }else{
            sumB+=i;
            countB++;
        }
    }
    printf("%.1f %.1f",sumA/countA,sumB/countB);
    return 0;
}
